From 31d2d1e08a0a7334d031c6a8ae98d0942f9e6362 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Thu, 10 Jul 2014 15:35:28 +0000 Subject: [PATCH] Move xenstore and libxc public headers to include subdir Also moves xc_dom.h to include as it is used often by other xen tools. Use the new include subdirectories to build Xen tools, qemu-xen and stubdoms. Add the old libxc include path to the programs that need it to build, on a case by case basis and commeting that they shouldn't require internal libxc headers to build. [ And: update QEMU_TRADITIONAL_REVISION to corresponding qemu patch - Ian jackson ] Signed-off-by: Stefano Stabellini --- Config.mk | 6 +++--- extras/mini-os/Config.mk | 2 +- stubdom/Makefile | 2 ++ stubdom/grub/Makefile | 2 +- tools/Makefile | 6 +++--- tools/Rules.mk | 6 +++--- tools/blktap2/drivers/Makefile | 2 ++ tools/libxc/Makefile | 6 +++--- tools/libxc/{ => include}/xc_dom.h | 0 tools/libxc/{ => include}/xenctrl.h | 0 tools/libxc/{ => include}/xenctrlosdep.h | 0 tools/libxc/{ => include}/xenguest.h | 0 tools/libxc/{ => include}/xentoollog.h | 0 tools/misc/Makefile | 2 ++ tools/ocaml/libs/eventchn/xeneventchn.mli | 2 +- tools/ocaml/libs/xentoollog/Makefile | 2 +- tools/ocaml/libs/xentoollog/genlevels.py | 2 +- tools/python/setup.py | 6 +++--- tools/xcutils/Makefile | 3 ++- tools/xenpaging/Makefile | 3 ++- tools/xenstore/Makefile | 9 +++++---- tools/xenstore/{ => include}/compat/xs.h | 0 tools/xenstore/{ => include}/compat/xs_lib.h | 0 tools/xenstore/{ => include}/xenstore.h | 0 tools/xenstore/{ => include}/xenstore_lib.h | 0 25 files changed, 35 insertions(+), 26 deletions(-) rename tools/libxc/{ => include}/xc_dom.h (100%) rename tools/libxc/{ => include}/xenctrl.h (100%) rename tools/libxc/{ => include}/xenctrlosdep.h (100%) rename tools/libxc/{ => include}/xenguest.h (100%) rename tools/libxc/{ => include}/xentoollog.h (100%) rename tools/xenstore/{ => include}/compat/xs.h (100%) rename tools/xenstore/{ => include}/compat/xs_lib.h (100%) rename tools/xenstore/{ => include}/xenstore.h (100%) rename tools/xenstore/{ => include}/xenstore_lib.h (100%) diff --git a/Config.mk b/Config.mk index 4c3a2a7b4b..2bb8dcca1b 100644 --- a/Config.mk +++ b/Config.mk @@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5 ETHERBOOT_NICS ?= rtl8139 8086100e -QEMU_TRADITIONAL_REVISION ?= d0395cc49b2ec6d1723c01f1daf2394b9264ca29 -# Tue Apr 8 16:50:06 2014 +0000 -# qemu-xen-trad: free all the pirqs for msi/msix when driver unloads +QEMU_TRADITIONAL_REVISION ?= 58fac0693d8ad591add917e939011fe069720b0c +# Fri Aug 1 16:32:18 2014 +0100 +# qemu-xen-trad: -I tools/libxc/include and tools/xenstore/include # Specify which qemu-dm to use. This may be `ioemu' to use the old # Mercurial in-tree version, or a local directory, or a git URL. diff --git a/extras/mini-os/Config.mk b/extras/mini-os/Config.mk index d61877bb45..48524438e6 100644 --- a/extras/mini-os/Config.mk +++ b/extras/mini-os/Config.mk @@ -46,7 +46,7 @@ DEF_CPPFLAGS += -D__MINIOS__ ifeq ($(libc),y) DEF_CPPFLAGS += -DHAVE_LIBC DEF_CPPFLAGS += -isystem $(MINI-OS_ROOT)/include/posix -DEF_CPPFLAGS += -isystem $(XEN_ROOT)/tools/xenstore +DEF_CPPFLAGS += -isystem $(XEN_ROOT)/tools/xenstore/include endif ifneq ($(LWIPDIR),) diff --git a/stubdom/Makefile b/stubdom/Makefile index 1e96d679b1..81f6d5ab91 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -307,12 +307,14 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET) mkdir -p libxc-$(XEN_TARGET_ARCH) [ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \ ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \ + ln -sf $(XEN_ROOT)/tools/libxc/include/*.h . && \ ln -sf $(XEN_ROOT)/tools/libxc/*.c . && \ ln -sf $(XEN_ROOT)/tools/libxc/Makefile . ) mkdir -p xenstore [ -h xenstore/Makefile ] || ( cd xenstore && \ ln -sf $(XEN_ROOT)/tools/xenstore/*.c . && \ ln -sf $(XEN_ROOT)/tools/xenstore/*.h . && \ + ln -sf $(XEN_ROOT)/tools/xenstore/include/*.h . && \ ln -sf $(XEN_ROOT)/tools/xenstore/Makefile . ) $(MAKE) DESTDIR= -C $(MINI_OS) links touch mk-headers-$(XEN_TARGET_ARCH) diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile index 6bd2c4c9f1..934cc4c73c 100644 --- a/stubdom/grub/Makefile +++ b/stubdom/grub/Makefile @@ -5,7 +5,7 @@ vpath %.c ../grub-upstream BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o -DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc -I$(XEN_ROOT)/tools/include -I. +DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include -I$(XEN_ROOT)/tools/include -I. DEF_CPPFLAGS += -I../grub-upstream/stage1 DEF_CPPFLAGS += -I../grub-upstream/stage2 DEF_CPPFLAGS += -I../grub-upstream/netboot diff --git a/tools/Makefile b/tools/Makefile index b6476c909e..11303699dc 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -192,9 +192,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find --includedir=$(PREFIX)/lib/xen/include \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \ - -I$(XEN_ROOT)/tools/libxc \ - -I$(XEN_ROOT)/tools/xenstore \ - -I$(XEN_ROOT)/tools/xenstore/compat \ + -I$(XEN_ROOT)/tools/libxc/include \ + -I$(XEN_ROOT)/tools/xenstore/include \ + -I$(XEN_ROOT)/tools/xenstore/compat/include \ $(EXTRA_CFLAGS_QEMU_XEN)" \ --extra-ldflags="-L$(XEN_ROOT)/tools/libxc \ -L$(XEN_ROOT)/tools/xenstore \ diff --git a/tools/Rules.mk b/tools/Rules.mk index fa59365cf1..e2fdf63499 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -35,15 +35,15 @@ INSTALL_SHLIB = : install-shlib-unsupported-fail SYMLINK_SHLIB = : symlink-shlib-unsupported-fail endif -CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) +CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude) LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension) SHLIB_libxenctrl = -Wl,-rpath-link=$(XEN_LIBXC) -CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_xeninclude) +CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude) LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest$(libextension) SHLIB_libxenguest = -Wl,-rpath-link=L$(XEN_LIBXC) -CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_xeninclude) +CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude) LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore$(libextension) SHLIB_libxenstore = -Wl,-rpath-link=$(XEN_XENSTORE) diff --git a/tools/blktap2/drivers/Makefile b/tools/blktap2/drivers/Makefile index 37c3485e3b..3476fc1c34 100644 --- a/tools/blktap2/drivers/Makefile +++ b/tools/blktap2/drivers/Makefile @@ -16,6 +16,8 @@ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += -D_GNU_SOURCE CFLAGS += -DUSE_NFS_LOCKS +# drivers/block-log.c incorrectly uses libxc internals +CFLAGS += -I$(XEN_ROOT)/tools/libxc ifeq ($(CONFIG_X86_64),y) CFLAGS += -fPIC diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 3c390f8c5b..c4843212d4 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -89,7 +89,7 @@ OSDEP_SRCS-y += xenctrl_osdep_ENOSYS.c -include $(XEN_TARGET_ARCH)/Makefile CFLAGS += -Werror -Wmissing-prototypes -CFLAGS += -I. $(CFLAGS_xeninclude) +CFLAGS += -I. -I./include $(CFLAGS_xeninclude) # Needed for posix_fadvise64() in xc_linux.c CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE @@ -148,12 +148,12 @@ install: build $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR) $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR) $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so - $(INSTALL_DATA) xenctrl.h xenctrlosdep.h xentoollog.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h include/xentoollog.h $(DESTDIR)$(INCLUDEDIR) $(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR) $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR) $(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR) $(SYMLINK_SHLIB) libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so - $(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/xenguest.h $(DESTDIR)$(INCLUDEDIR) .PHONY: TAGS TAGS: diff --git a/tools/libxc/xc_dom.h b/tools/libxc/include/xc_dom.h similarity index 100% rename from tools/libxc/xc_dom.h rename to tools/libxc/include/xc_dom.h diff --git a/tools/libxc/xenctrl.h b/tools/libxc/include/xenctrl.h similarity index 100% rename from tools/libxc/xenctrl.h rename to tools/libxc/include/xenctrl.h diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/include/xenctrlosdep.h similarity index 100% rename from tools/libxc/xenctrlosdep.h rename to tools/libxc/include/xenctrlosdep.h diff --git a/tools/libxc/xenguest.h b/tools/libxc/include/xenguest.h similarity index 100% rename from tools/libxc/xenguest.h rename to tools/libxc/include/xenguest.h diff --git a/tools/libxc/xentoollog.h b/tools/libxc/include/xentoollog.h similarity index 100% rename from tools/libxc/xentoollog.h rename to tools/libxc/include/xentoollog.h diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 69b18176ce..266fd167d8 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -6,6 +6,8 @@ CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_xeninclude) CFLAGS += $(CFLAGS_libxenstore) +# xen-hptool.c and xen-mfndump.c incorrectly use libxc internals +CFLAGS += -I$(XEN_ROOT)/tools/libxc HDRS = $(wildcard *.h) diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli index e4e02a4a81..e18014595b 100644 --- a/tools/ocaml/libs/eventchn/xeneventchn.mli +++ b/tools/ocaml/libs/eventchn/xeneventchn.mli @@ -14,7 +14,7 @@ * GNU Lesser General Public License for more details. *) -(** Event channel bindings: see tools/libxc/xenctrl.h *) +(** Event channel bindings: see tools/libxc/include/xenctrl.h *) type handle (** An initialised event channel interface. *) diff --git a/tools/ocaml/libs/xentoollog/Makefile b/tools/ocaml/libs/xentoollog/Makefile index 471b42811d..f2134b8643 100644 --- a/tools/ocaml/libs/xentoollog/Makefile +++ b/tools/ocaml/libs/xentoollog/Makefile @@ -48,7 +48,7 @@ xentoollog.mli: xentoollog.mli.in _xtl_levels.mli.in libs: $(LIBS) -_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libxc/xentoollog.h +_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py $(XEN_ROOT)/tools/libxc/include/xentoollog.h $(PYTHON) genlevels.py _xtl_levels.mli.in _xtl_levels.ml.in _xtl_levels.inc .PHONY: install diff --git a/tools/ocaml/libs/xentoollog/genlevels.py b/tools/ocaml/libs/xentoollog/genlevels.py index 6b42f21882..65d334f936 100755 --- a/tools/ocaml/libs/xentoollog/genlevels.py +++ b/tools/ocaml/libs/xentoollog/genlevels.py @@ -3,7 +3,7 @@ import sys def read_levels(): - f = open('../../../libxc/xentoollog.h', 'r') + f = open('../../../libxc/include/xentoollog.h', 'r') levels = [] record = False diff --git a/tools/python/setup.py b/tools/python/setup.py index 17ebb4a341..439c429e99 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -13,7 +13,7 @@ PATH_XENSTORE = XEN_ROOT + "/tools/xenstore" xc = Extension("xc", extra_compile_args = extra_compile_args, - include_dirs = [ PATH_XEN, PATH_LIBXC, "xen/lowlevel/xc" ], + include_dirs = [ PATH_XEN, PATH_LIBXC + "/include", "xen/lowlevel/xc" ], library_dirs = [ PATH_LIBXC ], libraries = [ "xenctrl", "xenguest" ], depends = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ], @@ -21,7 +21,7 @@ xc = Extension("xc", xs = Extension("xs", extra_compile_args = extra_compile_args, - include_dirs = [ PATH_XEN, PATH_XENSTORE, "xen/lowlevel/xs" ], + include_dirs = [ PATH_XEN, PATH_XENSTORE + "/include", "xen/lowlevel/xs" ], library_dirs = [ PATH_XENSTORE ], libraries = [ "xenstore" ], depends = [ PATH_XENSTORE + "/libxenstore.so" ], @@ -29,7 +29,7 @@ xs = Extension("xs", xl = Extension("xl", extra_compile_args = extra_compile_args, - include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC, "xen/lowlevel/xl" ], + include_dirs = [ PATH_XEN, PATH_LIBXL, PATH_LIBXC + "/include", "xen/lowlevel/xl" ], library_dirs = [ PATH_LIBXL ], libraries = [ "xenlight" ], depends = [ PATH_LIBXL + "/libxenlight.so" ], diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile index 98706bfd29..f71703ddac 100644 --- a/tools/xcutils/Makefile +++ b/tools/xcutils/Makefile @@ -15,7 +15,8 @@ PROGRAMS = readnotes lsevtchn CFLAGS += -Werror -CFLAGS_readnotes.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) +# incorrectly uses libxc internals +CFLAGS_readnotes.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc CFLAGS_lsevtchn.o := $(CFLAGS_libxenctrl) .PHONY: all diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile index fedd0fb0c3..3734ca6127 100644 --- a/tools/xenpaging/Makefile +++ b/tools/xenpaging/Makefile @@ -1,7 +1,8 @@ XEN_ROOT=$(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk -CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) +# xenpaging.c and file_ops.c incorrectly use libxc internals +CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS) LDFLAGS += $(PTHREAD_LDFLAGS) diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 48f1e96d0e..cff57edf72 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -7,6 +7,7 @@ MINOR = 3 CFLAGS += -Werror CFLAGS += -I. CFLAGS += -I$(XEN_ROOT)/tools/ +CFLAGS += -I./include CFLAGS += $(CFLAGS_libxenctrl) CFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_CFLAGS) @@ -141,10 +142,10 @@ endif ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR) ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so $(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR) - $(INSTALL_DATA) xenstore.h $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_DATA) xenstore_lib.h $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_DATA) compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h - $(INSTALL_DATA) compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h + $(INSTALL_DATA) include/xenstore.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/xenstore_lib.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) include/compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs.h + $(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xenstore-compat/xs_lib.h ln -sf xenstore-compat/xs.h $(DESTDIR)$(INCLUDEDIR)/xs.h ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(INCLUDEDIR)/xs_lib.h diff --git a/tools/xenstore/compat/xs.h b/tools/xenstore/include/compat/xs.h similarity index 100% rename from tools/xenstore/compat/xs.h rename to tools/xenstore/include/compat/xs.h diff --git a/tools/xenstore/compat/xs_lib.h b/tools/xenstore/include/compat/xs_lib.h similarity index 100% rename from tools/xenstore/compat/xs_lib.h rename to tools/xenstore/include/compat/xs_lib.h diff --git a/tools/xenstore/xenstore.h b/tools/xenstore/include/xenstore.h similarity index 100% rename from tools/xenstore/xenstore.h rename to tools/xenstore/include/xenstore.h diff --git a/tools/xenstore/xenstore_lib.h b/tools/xenstore/include/xenstore_lib.h similarity index 100% rename from tools/xenstore/xenstore_lib.h rename to tools/xenstore/include/xenstore_lib.h -- 2.30.2